import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '姓名',
    align: "center",
    dataIndex: 'name'
  },
  {
    title: '年龄',
    align: "center",
    dataIndex: 'age'
  },
  {
    title: '头像',
    align: "center",
    dataIndex: 'avatar',
    customRender: render.renderImage,
  },
  {
    title: '性别',
    align: "center",
    dataIndex: 'sex_dictText'
  },
  {
    title: '生日',
    align: "center",
    dataIndex: 'birthday',
    customRender:({text}) =>{
      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
      return text;
    },
  },
  {
    title: '兴趣爱好',
    align: "center",
    dataIndex: 'hobbies_dictText'
  },
  {
    title: '婚姻状态',
    align: "center",
    dataIndex: 'maritalStatus_dictText'
  },
  {
    title: '状态',
    align: "center",
    dataIndex: 'status',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}]);
     },
  },
  {
    title: '描述',
    align: "center",
    dataIndex: 'remark',
  },
];

// 高级查询数据
export const superQuerySchema = {
  name: {title: '姓名',order: 0,view: 'text', type: 'string',},
  age: {title: '年龄',order: 1,view: 'number', type: 'number',},
  avatar: {title: '头像',order: 2,view: 'image', type: 'string',},
  sex: {title: '性别',order: 3,view: 'radio', type: 'string',dictCode: 'sex',},
  birthday: {title: '生日',order: 4,view: 'date', type: 'string',},
  hobbies: {title: '兴趣爱好',order: 5,view: 'checkbox', type: 'string',dictCode: 'hobbies',},
  maritalStatus: {title: '婚姻状态',order: 6,view: 'list', type: 'string',dictCode: 'marital_status',},
  status: {title: '状态',order: 7,view: 'switch', type: 'string',},
  remark: {title: '描述',order: 8,view: 'umeditor', type: 'string',},
};
